#include "pokemon.h"

void draw_bg(uint32_t color) {
    SDL_SetRenderDrawColor(render, partr(color), partg(color), partb(color), parta(color));
    SDL_RenderClear(render);
    draw_rect(0, 0, WINDOW_W, WINDOW_H);
}

void draw_scene() {

}

void draw_battle() {

}

void init_pokemon() {
    uint32_t white = 0xffffffff;
    draw_bg(white);
    frame = 0;
    cynthsprite = CYN01;
}

void update_pokemon() {
    draw_bg(0xFFFFFFFF);

    SDL_Rect cynthia_rect = { (WINDOW_W / 2) - 32, (WINDOW_H / 2) - 32, 64, 64 };
    /* the dream */
    //draw_img(sprite_table[cynthsprite], &cynthia_rect);
    printf("cynthiasprite is currently %d\n", cynthsprite);
    draw_img("/home/noby/c/pokemonchrysoberyl/res/cyn003.png", &cynthia_rect);

    frame++;
    if (frame >= 60)
        frame = frame % 60;
}

void set_cynth_sprite(SPRITE sprite) {
    cynthsprite = sprite;
    printf("cynth sprite set to %d\n", sprite);
}
